//! 常量表

#[cfg(feature = "end")]
#[path = "end.rs"]
mod role;
#[cfg(feature = "server")]
#[path = "server.rs"]
mod role;
#[cfg(not(any(feature = "end", feature = "server")))]
#[path = "router.rs"]
mod role;

use heapless::consts::*;

/// 前导长度(最小3)
pub const LEAD_LEN: usize = 4;
/// 链路uid长度
pub type UidLen = U32;
/// 历史记录长度
pub type HistoryLen = U16;
/// 子协议数
pub type ProtocolLen = U4;
/// 定时任务数
pub type TaskLen = U8;

/// 数据帧长度(包含前导)
pub const FRAME_LEN: usize = 256;
/// 数据帧长度(包含前导)
pub type FrameLen = U256;
/// 负载长度
pub const LOAD_LEN: usize = 240;
/// 数据包长度
pub const PACKET_LEN: usize = 240;
/// 数据包长度
pub type PacketLen = U240;
/// 数据长度
pub const DATA_LEN: usize = 180;
/// 数据长度
pub type DataLen = U180;

pub use role::*;
